

#include "queue.h"
#include <stdio.h>

#if USE_QUEUE

static Queue_t QUEUE_STATIC;
static Queue_t QUEUE_ARRAY[16];

int create_queue()
{
    return 16;
}

int add(void *obj)
{
    int ii;
    
    for (ii=0; ii<16; ii ++)
    {
        if (QUEUE_ARRAY[ii].obj == NULL)
        {
            QUEUE_ARRAY[ii].obj = obj;
            return 0;
        }
    }
    return -1;
}

int del(void *obj)
{
    int ii;
    
    for (ii=0; ii<16; ii ++)
    {
        if (QUEUE_ARRAY[ii].obj == obj)
        {
            QUEUE_ARRAY[ii].obj = NULL;
            return 0;
        }
    }
    return -1;
}

void *get(int i)
{
    return QUEUE_ARRAY[i].obj;
}

int free_queue()
{
    // do NULL   
}
#endif